home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
Dots & Pixels
/
headers
/
movingnoisedots.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-29
|
988b
|
42 lines
#pragma once
//
// class movingnoisedots generates random dots which move at a given speed
// in random directions which very at every timestep.
//
class movingnoisedots : public dotcollection,
public phaser, public screendots
{
public:
movingnoisedots( int numbits, int xpos, int ypos,
int aantaldots, int lifetime, int noiseBits);
movingnoisedots( int numbits, screen_position where,
int aantaldots, int lifetime, int noiseBits);
protected:
virtual void compute_addresses();
private:
const unsigned long noiseMask;
const unsigned long noiseShift;
void move_the_dots();
//
// we use 'short_long_hack' to split an unsigned long in two
// signed shorts (the unsigned long being returned by randomizer_step())
// (could move these to 'dotcollection' and add a member 'uniformize')
//
typedef struct two_shorts
{
short left;
short right;
};
typedef union short_long_hack
{
two_shorts shorties;
unsigned long ulong;
};
};